package com.yanqu.road.server.cmd.orewar;

import com.yanqu.road.pb.orewar.OreWarProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.player.OreWarModule;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.S_ORE_WAR_HP_SYNC, desc = "获取用户Hp信息")
public class OreGetUserHpCmd extends AbstractCommand {

	private int activityId;

	@Override
	public boolean parseData(YanQuMessage packet) throws Exception {
		return true;
	}

	@Override
	public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
		OreWarProto.OreWarHpReqMsg reqMsg = OreWarProto.OreWarHpReqMsg.parseFrom(packet.getBytes());
		activityId = reqMsg.getActivityId();
		player.getModule(OreWarModule.class).syncUserOreWarHp(activityId);
	}

	@Override
	public void sendData(GamePlayer player) {

	}

}
